POV-Ray : Newsgroups : povray.advanced-users : Media and density question : Re: Media and density question Server Time
28 Jul 2024 22:29:54 EDT (-0400)
  Re: Media and density question  
From: Erhard Ducke
Date: 2 Dec 2003 09:58:59
Message: <nk9psvcnts17omiukiqjcc3541mht4ag7e@4ax.com>
On 2 Dec 2003 06:08:55 -0500, Warp <war### [at] tagpovrayorg> wrote:

>  He wanted a constant density up to certain radius, after which the
>density should drop linearly to 0 on the outer surface of the pattern.
>  So instead of the [1 rgb 1] he should write [1-P rgb 1] where P is the
>desired percentage of the radius (between 0 and 1).

//*************************************
         media {
              scattering {4, <1,1,1>}
              intervals 1
                   
              density {
                    spherical scale (SphereRadius)
                        density_map { 
                            [0 rgb 0]
                            [.1*SphereRadius rgb 1]
                            [1 rgb 1]
                        }
                      }
                    }
 //**************************************

The above code is working now...
Density remains constant from center to 0.9*SphereRadius and drops linearly
to 0 on the outer surface of the sphere...
I wonder whether the density can be modified to drop logarithmical, not
linear, this would give even a better effect...
-- 
Erhard Ducke


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.